
export const cookie = (name:string):string => {
  const rEMArray = document.cookie.match(new RegExp('(^| )' + name + '=([^;]*)(;|$)'))
  if (rEMArray === null) {
    return ''
  } else {
    return rEMArray[2]
  }
}

export const getQuery = (name:string):string => {
  const rEMArray = window.location.search.replace('?', '').match(new RegExp('(^|&)' + name + '=([^&]*)(&|$)'))
  if (rEMArray === null) {
    return ''
  } else {
    return rEMArray[2]
  }
}
